#----------------------------------*-sh-*--------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     | Website:  https://openfoam.org
#   \\  /    A nd           | Copyright (C) 2021-2024 OpenFOAM Foundation
#    \\/     M anipulation  |
#------------------------------------------------------------------------------
# License
#     This file is part of OpenFOAM.
#
#     OpenFOAM is free software: you can redistribute it and/or modify it
#     under the terms of the GNU General Public License as published by
#     the Free Software Foundation, either version 3 of the License, or
#     (at your option) any later version.
#
#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
#     for more details.
#
#     You should have received a copy of the GNU General Public License
#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
#
# File
#     etc/config.sh/zoltan
#
# Description
#     Setup file for zoltan include/libraries.
#     Sourced during wmake process only.
#
# Note
#     A csh version is not needed, since the values here are only sourced
#     during the wmake process
#
#------------------------------------------------------------------------------

# Load functions
. $WM_PROJECT_DIR/etc/config.sh/functions

# Find the path to the zoltan installation
case "$ZOLTAN_TYPE" in
none)
    ;;
system)
    export ZOLTAN_VERSION=system
    export ZOLTAN_ARCH_PATH=/usr
    ;;
OpenFOAM | ThirdParty)
    # Look for the source directory
    if [ -z "$ZOLTAN_VERSION" ]
    then
        zoltanSrcDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/Zoltan-*)
    else
        zoltanSrcDir=$WM_THIRD_PARTY_DIR/Zoltan-$ZOLTAN_VERSION
    fi
    # Set the version and the installation path
    if [ -d "$zoltanSrcDir" ]
    then
        export ZOLTAN_VERSION=${zoltanSrcDir##*Zoltan-}
        export ZOLTAN_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/Zoltan-$ZOLTAN_VERSION
    fi
    # Clean up
    unset zoltanSrcDir
    ;;
esac

# Unload functions
. $WM_PROJECT_DIR/etc/config.sh/functions


#------------------------------------------------------------------------------
